   <!-- Content Bar Header -->
      <?php
      $auth = Auth::getAuth('current_user');
      $db = new Database();
      $fs = new functions;
      $search = new Search();

      
      $form_id = $_GET['id'];
         if($auth['user_level_id']=="2"){
            echo $this->setInclude("contentHeader",null,null,null);
         }
         $forms = $db->query("SELECT * FROM tb_workspace WHERE id = {$db->escape($form_id)}","row");
         $active_form = $db->query("SELECT * FROM tb_workspace WHERE id = {$db->escape($form_id)} AND is_active = 1","array");

         //get active fields
         $active_fields = functions::getFormFields($form_id);

         //set form authors
         $formPrivacy_authors = $search->getFormPrivacyUsers($forms['form_authors']);
         
      ?>
<div class="content_wrapper">
   <div class="mainContent">
      <div>
         <div class="widget" style="border-bottom:none !important">
            <div class="head">
               <!--<div class="title_head">
                  <i class="icon-reorder"></i> <?php echo $forms['form_name']; ?>
               </div>-->
               <?php
               if(count($active_form)>0){
                  if($formPrivacy_authors){
                     ?>
                     <a href="/workspace?view_type=request&formID=<?php echo $form_id ?>&requestID=0" class="btn-blueBtn" style="margin-top: 5px;margin-left: 5px;float: left;padding: 3px;font-weight: bold;padding-left: 10px;width: 90px;padding-right: 10px;font-size: 11px;">Create Request</a>
                     <a class="btn-blueBtn" link-type ="import" link-form-id="<?php echo $form_id ?>" style="margin-top: 5px;margin-left: 5px;float: left;padding: 3px;font-weight: bold;padding-left: 10px;width: 38px;padding-right: 10px;font-size: 11px;">Import</a>
                     <?php
                  }
               }
               ?>
               <input type="text" value="<?php echo $form_id ?>" id="form_id" class="display"> 
               <div class="pull-right" style="margin:5px;">
                  <input type="button" class="btn-blueBtn search-requests" value="Go">
               </div>
               <div class="pull-right" style="margin:5px;">
                  <select class="input-select search-request-field" style="margin-top:0px;width: 150px;margin-right:0px;padding-top: 5px;">
                     <option value="0">All</option>
                     <?php
                        foreach ($active_fields as $value) {
                           echo "<option value='". $value ."'>". $value ."</option>";
                        }
                     ?>
                     <!-- Static fields in table -->
                     <option value="TrackNo">Tracking Number</option>
                     <option value="Requestor">Requestor</option>
                     <option value="Processor">Processor</option>
                     <option value="Status">Status</option>
                  </select>
               </div>
               <div class="pull-right" style="margin:5px;">
                  <input type="text" class="input-medium search-request-value" placeholder="Search">
               </div>
            </div>
            <div class="request-wrapper">
            <?php



               $getRequest = $search->getManyRequest("","0",$form_id);

               if(count($getRequest)==0){
                  ?>
                  <div class="notification_wrapper" style="height:auto">
                     <div class="wrong" style="width:98.5%">
                        <div class="padding_5">
                           <img src="/images/warning/wrong.png" width="22" height="19" class="img-notification-position">
                           <div class="notification-position">No Record Found</div>
                        </div>
                     </div>
                  </div>

                  <?php
               }else{
                  
                  //$formPrivacy_readers
                  foreach($getRequest as $request){                        
                     ?>
                     <div class="request-box request-redirect" href="#" style="cursor: pointer" form-id = "<?php echo $form_id; ?>" request-id="<?php echo $request['request_id']; ?>">
                        <div class="supTicket nobg">
                           <div class="issueSummary" style="padding-top:5px">
                                 <a href="#" title="" class="pull-left"><img src="/images/avatar/small.png" class="" width="50" height="50" alt="" style="border:none;"></a>	
                              <div class="ticketInfo" >
                                 <ul style="margin-left: 10px">
                                    <li><a href="#" title="" style="font-weight: bolder"><?php echo $request['first_name']." ".$request['last_name']; ?></a></li>
                                    <li class="even"><strong class="">[ <?php echo $request['TrackNo']; ?>  ]</strong></li>
                                    <li>Status: <strong class="green">[ <?php echo $request['form_status']; ?> ]</strong></li>
                                    <li class="even" style="font-size: 10px;color: rgb(158, 144, 144);"><?php echo $request['DateCreated']; ?></li>
                                 </ul>
                              </div>
                           </div>
                        </div>
                        <div class="hr" style="margin: 0;height: 3px"></div>
                     </div>
                     <?php
                  }
               }
            ?>
            </div>
         </div>
      </div>
   </div>
   <div class="mainContent_widget">
      <div>
         <div class="widget">
            <div class="head">
               <h5 class="iHelp">Support ticket widget</h5>
               <div class="num">
                  <a href="#" class="redNum">+128</a>
               </div>
            </div>
           
            <div class="supTicket nobg">
               <div class="issueType">
                  <span class="issueInfo">General financial issue</span>
                  <span class="issueNum">[ #21254 ]</span>
               </div>
               
               <div class="issueSummary">
                     <a href="#" title="" class="pull-left"><img src="/images/avatar/small.png" class="avatar" width="30" height="30" alt=""></a>	
                  <div class="ticketInfo">
                     <ul>
                        <li><a href="#" title="">Eugene Kopyov</a></li>
                        <li class="even"><strong class="red">[ High priority ]</strong></li>
                        <li>Status: <strong class="green">[ Pending ]</strong></li>
                        <li class="even">Oct 25, 2011  23:12</li>
                     </ul>
                  </div>
               </div> 
            </div>
         </div>
         
         <div class="widget" style="margin-top: 10px;min-height: 300px;">
            <div class="head">
               <h5 class="iHelp">Support ticket widget</h5>
               <div class="num">
                  <a href="#" class="redNum">+128</a>
               </div>
            </div>
           
           <div class="supTicket nobg">
               <div class="issueType">
                  <span class="issueInfo">General financial issue</span>
                  <span class="issueNum">[ #21254 ]</span>
               </div>
               
               <div class="issueSummary">
                  <a href="#" title="" class="pull-left">
                     <img src="/images/avatar/small.png" class="avatar" width="30" height="30" alt="">
                  </a>	
                  <div class="ticketInfo">
                     <ul>
                        <li><a href="#" title="">Eugene Kopyov</a></li>
                        <li class="even"><strong class="red">[ High priority ]</strong></li>
                        <li>Status: <strong class="green">[ Pending ]</strong></li>
                        <li class="even">Oct 25, 2011  23:12</li>
                     </ul>
                  </div>
               </div> 
            </div>
         </div>
         
         <div class="widget" style="margin-top: 10px;min-height: 300px;">
            <div class="head">
               <h5 class="iHelp">Support ticket widget</h5>
               <div class="num">
                  <a href="#" class="redNum">+128</a>
               </div>
            </div>
           
            <div class="supTicket nobg">
               <div class="issueType">
                  <span class="issueInfo">General financial issue</span>
                  <span class="issueNum">[ #21254 ]</span>
               </div>
               
               <div class="issueSummary">
                  <a href="#" title="" class="pull-left">
                     <img src="/images/avatar/small.png" class="avatar" width="30" height="30" alt="">
                  </a>	
                  <div class="ticketInfo">
                     <ul>
                        <li><a href="#" title="">Eugene Kopyov</a></li>
                        <li class="even"><strong class="red">[ High priority ]</strong></li>
                        <li>Status: <strong class="green">[ Pending ]</strong></li>
                        <li class="even">Oct 25, 2011  23:12</li>
                     </ul>
                  </div>
               </div> 
            </div>
         </div>
         
         
         <div class="widget" style="margin-top: 10px;min-height: 300px;">
            <div class="head">
               <h5 class="iHelp">Support ticket widget</h5>
               <div class="num">
                  <a href="#" class="redNum">+128</a>
               </div>
            </div>
           
            <div class="supTicket nobg">
               <div class="issueType">
                  <span class="issueInfo">General financial issue</span>
                  <span class="issueNum">[ #21254 ]</span>
               </div>
               
               <div class="issueSummary">
                  <a href="#" title="" class="pull-left"><img src="/images/avatar/small.png" class="avatar" width="30" height="30" alt=""></a>	
                  <div class="ticketInfo">
                     <ul>
                        <li><a href="#" title="">Eugene Kopyov</a></li>
                        <li class="even"><strong class="red">[ High priority ]</strong></li>
                        <li>Status: <strong class="green">[ Pending ]</strong></li>
                        <li class="even">Oct 25, 2011  23:12</li>
                     </ul>
                  </div>
               </div> 
            </div>
         </div>
      </div>
   </div>
</div>